﻿using System;
using System.IO;

namespace DataStore
{
    /// <summary>
    /// File manager class
    /// </summary>
    public class FileManager
    {
        /// <summary>
        /// Copies the file from source to destionation path.
        /// </summary>
        /// <param name="source">The source path.</param>
        /// <param name="destination">The destination path.</param>
        public static void Copy(string source, string destination)
        {
            using(FileStream fin = new FileStream(source, FileMode.Open))
            using (FileStream fout = new FileStream(destination, FileMode.Create))
            {
                int i;
                do
                {
                    i = fin.ReadByte();
                    if (i != -1) fout.WriteByte((byte) i);
                } while (i != -1);
            }
        }
    }
}